package creational.factory.simple;

import creational.factory.AbstractPhone;
import creational.factory.PhoneA;
import creational.factory.PhoneB;

/**
 * 简单工厂就是个笑话,弱爆了.
 *
 * @author binbin
 * @since 2022/10/4 23:16
 */
public class SimpleFactory {

    public static AbstractPhone getPhone(String type) {
        AbstractPhone phone = null;
        if ("a".equals(type)) {
            phone = new PhoneA();
        } else if ("b".equals(type)) {
            phone = new PhoneB();
        }
        return phone;
    }
}
